import React, { Component } from 'react'
import { Search } from '@react-vant/icons';
import _ from "lodash"


export class Header extends Component {
  constructor(props) {
    super(props)
     
    this.state = {
     val:''
    }
  }
  // changeValue=(e)=>{
  //   console.log(e.target.value)
  //   this.setState({
  //     val:e.target.value
  //   })
  // }
  
  render() {
    // const {changestate}=this.props
    const {serchfn}=this.props
    const {val}=this.state
    return (
      <div className='head'> 
      <input type="text" 
      // value={val} 
      onChange={_.debounce((e)=>{
       
          // this.setState({
          //  val:e.target.value
          // })
          serchfn(e.target.value)
         },1000)}
        />  
       {/* <Search onClick={
        ()=>{
           serchfn(val)
        }}/> */}
        </div>
    
    )
  }
}

export default Header

